package com.alogic.idnote.loader;

import com.alogic.idnote.IdNote;
import com.alogic.idnote.IdNoteGroup;
import com.alogic.load.Loader;

/**
 * XMLResource
 * @author yyduan
 * @since 1.6.12.13 [20181213 duanyy] <br>
 */
public class XmlResourceLoader extends Loader.XmlResource<IdNote> implements IdNoteGroup{

	@Override
	protected String getObjectXmlTag() {
		return "note";
	}

	@Override
	protected String getObjectDftClass() {
		return IdNote.Default.class.getName();
	}
	
	@Override
	public String getNote(String id, String dft) {
		IdNote note = getNote(id);
		return note != null ? note.getNote() : dft;
	}

	@Override
	public IdNote getNote(String id) {
		return load(id, true);
	}
}
